
package com.mephi.exception;


/**
 *
 * @author GM Mephisto
 * The base class for all exceptions raises in the application
 */
public class BaseApplicationException extends ApplicationException
{
	public BaseApplicationException()
    {
        super();
    }
	
	 /**
     * Constructs instance with message.
     * 
     * @param errorCode the errorCode of exception to set
     */
    public BaseApplicationException(String errorCode)
    {
        this(errorCode, errorCode);
    }

    /**
     * Constructs instance with set errorCode and message.
     * 
     * @param errorCode the code of error to set
     * @param message the message about exception to set
     */
    public BaseApplicationException(String errorCode, String message)
    {
        super(message);
        this.errorCode = errorCode;
    }

    /**
     * Constructs instance with set errorCode as a errorCode and as a message and cause.
     * 
     * @param errorCode the code of error to set
     * @param cause the cause to set
     */
    public BaseApplicationException(String errorCode, Throwable cause)
    {
        this(errorCode, errorCode, cause);
    }

    /**
     * Constructs instance with set errorCode as a errorCode and as a message and cause.
     * 
     * @param errorCode the code of error to set
     * @param message the message about exception to set
     * @param cause the cause to set
     */
    public BaseApplicationException(String errorCode, String message, Throwable cause)
    {
        super(message, cause);
        this.errorCode = errorCode;
    }

    /**
     * Returns the code of error.
     * 
     * @return errorCode
     * @see ApplicationException#getErrorCode()
     */
    public String getErrorCode()
    {
        return errorCode;
    }

    
    private static final long serialVersionUID = 1134786341041664414L;
    // errorCode of this exception
    private String errorCode;
}
